package cn.edu.xjtu.tencent.formal;

import java.util.ArrayList;

/**
 * @author Hydrion-QLz
 * @date 2022-09-13 20:59
 * @description
 */
public class forth {
    public ListNode solve(ListNode S) {
        // write code here
        ArrayList<Integer> list = new ArrayList<>();
        int max = 0;
        int max_idx = 0;
        int count = 0;
        while (S != null) {
            list.add(S.val);
            if (S.val >= max) {
                max = S.val;
                max_idx = count;
            }
            S = S.next;
            count++;
        }
        return null;
    }
}
